package com.yswwpp.cross;

import java.io.UnsupportedEncodingException;


public abstract class Coder implements IProtocol
{
    public int safeGetByteLength(String str)
    {
        try
        {
            return (str == null) ? 0 : str.getBytes(CHARTSET_NAME_UTF_8).length;
        } catch (UnsupportedEncodingException e)
        {
            return 0;
        }
    }

   
}
